package com.ld.control.business.chart.controller;


import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ld.control.business.chart.service.ChartService;
import com.ld.control.business.chart.vo.resp.FoldLineRespVo;
import com.ld.control.business.equipment.vo.resp.EquipmentRespVo;
import com.ld.control.business.task.vo.req.TaskExampleSearchReqVo;
import com.ld.control.business.task.vo.resp.TaskExampleRespVo;
import com.ld.control.common.ResultResponse;
import com.ld.control.common.vo.GeneratePageListVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Slf4j
@Tag(name = "图表相关接口")
@RestController
public class ChartController {

    @Autowired
    private ChartService chartService;

    @GetMapping("/api/centralControl/chart/getHomeFoldLineChart")
    @Operation(summary = "首页折线图")
    public ResultResponse<FoldLineRespVo> getPageList(
            @Parameter(description = "0按周展示，1按月展示，2按年展示") @RequestParam(required = true, defaultValue = "0") Integer viewType
    ) {
        FoldLineRespVo homeFoldLineChart = chartService.getHomeFoldLineChart(viewType);
        return ResultResponse.success(homeFoldLineChart);
    }


}
